package com.jgzx.domain;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author jackesy
 * @className: PageDTO
 * @description: 分页请求DTO
 * @create 2020/9/10 17:04
 **/
@ApiModel(value = "分页请求DTO")
@Data
public class PageDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "页码")
    @NotNull
    private Integer page_num = 1;

    @ApiModelProperty(value = "每页大小")
    @NotNull
    private Integer page_size = 20;

    public Page getPage() {
        return new Page(this.page_num, this.page_size);
    }
}
